var cavas = document.getElementById("gameCavas") as HTMLCanvasElement
var context = cavas.getContext("2d");
var y = 50;
var image = new Image();
image.src = 'gakki.jpg';
image.width

//main loop
function enterFrame() {
    if (!context) {
        return;
    }
    y++;
    cavas.width = cavas.height = 800;
    context.drawImage(image, 0, 0);
    context.rect(0, y, 50, 50);
    context.fillStyle = 'green';
    context.fill();
    context.fillStyle = 'black'
    context.fillText("GameBoy", 50, 100);
    requestAnimationFrame(enterFrame);
    if (y > 300) {
        y = 50;
    }


}

requestAnimationFrame(enterFrame);